package com.guoxue.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.guoxue.dao.IAdvertisementDao;
import com.guoxue.domain.AdvertisementVo;
@Repository
public class AdvertisementDaoImpl extends BaseDaoImpl<AdvertisementVo> implements IAdvertisementDao{

	@Override
	public List<AdvertisementVo> getAdvertisementList() {
		return find("FROM AdvertisementVo ");
	}

	@Override
	public void saveAdvertisement(AdvertisementVo a) {
		saveOrUpdate(a);
	}

	@Override
	public void deleteAdvertisement(Integer id) {
		executeHql("DELETE FROM AdvertisementVo a WHERE a.id = ?", new Object[] {id});
	}

	@Override
	public List<AdvertisementVo> getNotExpiredAdvertisementList() {
		return find("FROM AdvertisementVo ");
	}

}
